Skip to content

docs: document Java dedup agent setup#848

Merged
officialasishkumar merged 7 commits intomainfrom
codex/java-dedup-agent
Apr 30, 2026
Merged

docs: document Java dedup agent setup#848
officialasishkumar merged 7 commits intomainfrom
codex/java-dedup-agent

Conversation

@officialasishkumar
Copy link
Copy Markdown
Member

@officialasishkumar officialasishkumar commented Apr 29, 2026

What has changed?

Documents the Java dynamic dedup runtime-agent flow using io.keploy:keploy-sdk:2.0.6. The docs now say the Keploy SDK should be copied as a Java agent, not added as an application dependency, and application code should not import Keploy classes.

The Java guide covers:

  • attaching the Keploy Java agent and JaCoCo agent with -javaagent
  • in-process JaCoCo runtime coverage
  • Maven/Gradle classes, Spring Boot jars, Dropwizard/Jersey apps, classpath apps, servlet/WAR layouts, and custom KEPLOY_JAVA_CLASS_DIRS
  • Docker and restricted Docker socket requirements
  • shaded/uber-jar Docker guidance: copy compiled application classes into the image and set KEPLOY_JAVA_CLASS_DIRS so dependency classes do not participate in dedup signatures
  • running keploy test --dedup --language java
  • Apache Karaf agent download commands for the separate S3-hosted Karaf agent distribution

This PR Resolves # NA

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Documentation update (if none of the other choices apply).

How Has This Been Tested?

  • git diff --check -- versioned_docs/version-4.0.0/keploy-cloud/deduplication.md versioned_docs/version-4.0.0/server/sdk-installation/java.md
  • Verified the updated docs reference 2.0.6 for the io.keploy:keploy-sdk Maven coordinate in both keploy-cloud/deduplication.md and server/sdk-installation/java.md.
  • Verified Maven metadata lists 2.0.6 as the latest/release version for io.keploy:keploy-sdk, and the 2.0.6 jar returns HTTP 200 from Maven Central.
  • Verified the 2.0.6 jar manifest has Premain-Class: io.keploy.dedup.KeployDedupAgent and Implementation-Version: 2.0.6.
  • Verified the GitHub release v2.0.6 is marked latest and has the same jar assets attached.
  • Verified the docs now include explicit Docker class-root guidance with KEPLOY_JAVA_CLASS_DIRS=/app/classes, matching the validated samples-java Dropwizard Docker fix.
  • The Karaf doc (running-keploy/keploy-karaf.md) was bumped from io.keploy.agent-2.0.1.jar to io.keploy.agent-2.0.2.jar. This is a separate S3-hosted Karaf record/test agent distribution, not the Maven Central dynamic-dedup keploy-sdk artifact.
  • Earlier branch validation covered yarn install --frozen-lockfile, yarn build, and Vale checks for the Java SDK installation and deduplication docs.

Related PRs:

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.

@officialasishkumar officialasishkumar marked this pull request as ready for review April 30, 2026 04:30
@officialasishkumar officialasishkumar force-pushed the codex/java-dedup-agent branch 3 times, most recently from ed6514b to 2674b14 Compare April 30, 2026 05:10
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Latest io.keploy:keploy-sdk release on Maven Central with the
shaded dedup agent jar.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Reading the Java dedup docs end-to-end as a fresh user, several
sections were noise:

- TCP-fallback prose + KEPLOY_JACOCO_HOST/PORT + keploy.jacoco.* JVM
  properties + --pass-through-ports note. The SDK transparently
  falls back when the in-process JaCoCo runtime API is unavailable
  (rare); making the user think about it on page 1 of the setup is
  unhelpful. Removed entirely; the fallback path still works, it's
  just no longer in the user's face.
- /tmp/coverage_control.sock and /tmp/coverage_data.sock paths
  exposed in the main flow. Internal protocol detail; users don't
  need to know the socket names to attach -javaagent.
- "Hardened Docker runs are validated with non-root user, read-only
  root filesystem, dropped capabilities, no-new-privileges, ..."
  paragraph — that's the CI test matrix bragging, not user
  instruction. Trimmed to one sentence: "restricted containers
  work as long as /tmp stays writable."

Also fixed two real gaps a user actually hits:

- How to obtain jacocoagent.jar. Both docs said "attach -javaagent:
  /path/to/jacocoagent.jar" but never told the user where to get
  the file. Added a maven-dependency-plugin <execution> next to the
  existing keploy-sdk copy block that pulls
  org.jacoco:org.jacoco.agent:0.8.12:jar:runtime to
  target/jacocoagent.jar.
- JaCoCo version pin (0.8.12) is now explicit in Requirements +
  the maven snippet, so users on older versions know what we test
  against.
- One-line description of what dedupData.yaml and duplicates.yaml
  contain, instead of just naming them.

Net diff: deduplication.md -11 lines, java.md -10 lines, both
denser and easier to follow.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Remove the extra JaCoCo version note from the dynamic dedup docs now that the

tested version is already covered in requirements and the Maven copy snippet.

Also avoid spaced em dashes in the updated Java dedup docs and accept Karaf as

a Vale vocabulary term so the changed docs lint cleanly.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar merged commit d3a9c86 into main Apr 30, 2026
7 checks passed
@officialasishkumar officialasishkumar deleted the codex/java-dedup-agent branch April 30, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants